﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Inspire.Classes.DataStructures
{
    /// <summary>
    /// KeyValue pair.
    /// </summary>
    /// <typeparam name="TKey">Key</typeparam>
    /// <typeparam name="TValue">Value</typeparam>
    public class KeyValue<TKey, TValue>
    {
        private TKey key;

        /// <summary>
        /// Returns the Key object.
        /// </summary>
        public TKey Key
        {
            get
            {
                return this.key;
            }
        }

        private TValue value;

        /// <summary>
        /// Returns the Value object.
        /// </summary>
        public TValue Value
        {
            get
            {
                return this.value;
            }
        }

        /// <summary>
        /// Creates a new immutable KeyValue pair.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public KeyValue(TKey key, TValue value)
        {
            this.key = key;
            this.value = value;
        }

        /// <summary>
        /// Returns the value's ToString() representation;
        /// </summary>
        /// <returns>(string) Value.</returns>
        public override string ToString()
        {
            return this.Value.ToString();
        }
    }
}
